# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mpc1
pkgver=1.2.1
pkgrel=0
pkgdesc="Multiprecision C library"
url="http://www.multiprecision.org/"
arch="all"
license="LGPL-3.0-or-later"
makedepends_host="gmp-dev mpfr-dev>=4.1.0-r0"
makedepends="$makedepends_host"
subpackages="$pkgname-dev $pkgname-doc"
source="https://ftp.gnu.org/gnu/mpc/mpc-$pkgver.tar.gz"

builddir="$srcdir"/mpc-$pkgver

build() {
	# workaround for a bug in configure script
	EGREP=egrep \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--with-sysroot="$CBUILDROOT" \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--enable-shared
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="3279f813ab37f47fdcc800e4ac5f306417d07f539593ca715876e43e04896e1d5bceccfb288ef2908a3f24b760747d0dbd0392a24b9b341bc3e12082e5c836ee  mpc-1.2.1.tar.gz"
